<?php
/**
 * Created by PhpStorm.
 * User: zjw
 * Date: 2018/5/18
 * Time: 上午10:45
 */

namespace backend\controllers;

use common\jobs\LoadCouponDataJob;
use common\models\Activity;
use common\models\CouponCategory;
use common\service\HttpRequestService;
use yii\filters\AccessControl;
use yii\filters\VerbFilter;
use yii\web\Controller;
use yii\data\ActiveDataProvider;
use yii;
use mdm\admin\models\Menu;

class TestController extends Controller
{
    /**
     * @inheritdoc
     */
    public function behaviors()
    {
        return [
            'access' => [
                'class' => AccessControl::className(),
                'rules' => [
                    [
                        'allow' => true,
                        'roles' => ['@'],
                    ]
                ],
            ],
            'verbs' => [
                'class' => VerbFilter::className(),
                'actions' => [
                    'delete' => ['POST'],
                ],
            ],
        ];
    }

    public function actionIndex()
    {
//        $menuList = \mdm\admin\components\MenuHelper::getAssignedMenu(Yii::$app->user->id);
//        var_dump(Yii::$app->user->id);
//        var_dump($menuList);
//        var_dump(Menu::find()->all());
        return $this->render('/site/index', ['totalNum' => 1, 'useNum' => 0]);

    }


}
